package cn.tedu.exam1.certificate.controller;

import cn.tedu.exam1.base.response.JsonResult;
import cn.tedu.exam1.certificate.mapper.CertificateMapper;
import cn.tedu.exam1.certificate.pojo.dto.CertificateQuery;
import cn.tedu.exam1.certificate.pojo.vo.CertificateVO;
import cn.tedu.exam1.certificate.service.CertificateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/certificate")
public class CertificateController {
    @Autowired
    CertificateService certificateService;

    @GetMapping("select")
    public JsonResult select(CertificateQuery certificateQuery){
        log.debug("我是后端开头");
        log.debug("查询考试类别:certificateQuery={}",certificateQuery);
        List<CertificateVO> list =certificateService.select(certificateQuery);
        log.debug("我接收到返回数据啦");
        log.debug("类别数组:list={}",list);
        return JsonResult.ok(list);
    }
}
